@import '~antd/lib/style/mixins/clearfix.less';
@import "~antd/lib/style/color/colorPalette.less";

@import './vars';
:global {
  body {
    .ant-btn {
      min-width: 88px;
      &:focus {
        border-color: @normal-color;
        color: @text-color;
        background-color: @white;
        &:hover {
          border-color: ~`colorPalette("@{primary-color}", 5)`;
          color: ~`colorPalette("@{primary-color}", 5)`;
          background-color: @white;
        }
      }
      &.ant-btn-primary {
        &:focus {
          border-color: @primary-color;
          color: @white;
          background-color: @primary-color;

          &:hover {
            border-color: ~`colorPalette("@{primary-color}", 5)`;
            color: @white;
            background-color: ~`colorPalette("@{primary-color}", 5)`;
          }
        }
      }
      &.ant-btn-dashed {
        &:focus {
          border-color: @normal-color;
          color: @text-color;
          background-color: @white;
          &:hover {
            border-color: ~`colorPalette("@{primary-color}", 5)`;
            color: ~`colorPalette("@{primary-color}", 5)`;
            background-color: @white;
          }
        }
      }

      &.ant-btn-danger {
        &:focus {
          border-color: @normal-color;
          color: @danger-color;
          background-color: @bg-color;
          &:hover {
            border-color: @danger-color;
            color: @white;
            background-color: @danger-color;
          }
        }
      }
    }
    .ant-popover {
      .ant-btn {
        min-width: 0;
      }
    }
    .ant-tooltip {
      font-size: @font-size-base * 0.85;
    }
    .ant-breadcrumb a {
      color: @link;
    }
    .ant-modal-content {
      border-radius: 0;
      box-shadow: 0 10px 40px -10px fade(@black, 15);
    }
    .ant-modal-mask {
      background-color: fade(@black, 50);
    }
    .ant-calendar-picker {
      width: 100%;
    }
    .ant-layout-header {
      padding: 0 20px;
    }
    .ant-collapse-content-box {
      .clearfix;
    }
    ul {
      padding: 0;
      margin: 0;
    }
    li {
      list-style: none;
    }
    div.ant-layout[data-reactroot] {
      min-width: 1200px;
    }
    a {
      color: @link;
      &:hover {
        color: @link;
      }
      &:focus {
        text-decoration: none;
      }
    }
    .ant-menu-item {
      font-size: @font-size-base * 1.29px;
      padding: 0 0;
      > div {
        padding: 0 25px;
      }
    }
    .ant-table-tbody>tr:hover {
      td {
        background-color: inherit;
      }
    }
    .ant-table-tbody > tr > td.ant-table-selection-column {
      text-align: left;
    }
    .ant-table-selection-column > span,
    .ant-table-selection {
      width: 20px;
      text-align: right;
    }
    .ant-menu.ant-menu-dark .ant-menu-item-selected {
      background-color: transparent;
    }
    .ant-menu-dark.ant-menu-horizontal>.ant-menu-item {
      &:after {
        position: absolute;
        left: 20px;
        right: 20px;
        bottom: 14px;
        margin: auto;
        height: 4px;
        border-radius: 3px;
        background: @primary-color;
        content: "";
        opacity: 0;
        transition: opacity .3s, transform .3s;
        transform: translateY(14px);
      }
      &.ant-menu-item-selected {
        &:after {
          opacity: 1;
          transform: translateY(0);
        }
      }
    }
    .ant-row.ant-form-item.ant-col-6 {
      max-width: @input-max-width;
      min-width: @input-min-width;
    }
    .fr {
      float: right;
    }
    .fl {
      float: left;
    }
    .left {
      text-align: left;
    }
    .right {
      text-align: right;
    }
    @paddings: pb,
    pl,
    pt,
    pr;
    @directions: bottom,
    left,
    top,
    right;
    @margins: mb,
    ml,
    mt,
    mr;
    @sizes: 30,
    25,
    20,
    15,
    10,
    5,
    0;
    @typepadding: padding;
    @tpyemargin: margin;
    .loop(length(@paddings), @paddings, @directions, @typepadding);
    .loop(length(@margins), @margins, @directions, @tpyemargin);
    .loop(@count, @keys, @values, @type) when (@count > 0) {
      .loop(@count - 1, @keys, @values, @type);
      @v1: extract(@keys, @count);
      @v2: extract(@values, @count);
      .loop-size(@v1, @v2, @type, length(@sizes));
    }
    .loop-size(@v1, @v2, @type, @count) when (@count > 0) {
      .loop-size(@v1, @v2, @type, @count - 1);
      @v3: extract(@sizes, @count);
      .@{v1}-@{v3} {
        @{type}-@{v2}: @v3 * 1px;
      }
    }
    .ant-form-item-control-wrapper {
      padding-top: @input-height-base;
    }
    .ant-form-item-label+.ant-form-item-control-wrapper {
      padding-top: 0;
    }
  }
}
